﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using WF = CPPEI.WorkflowCore;

namespace Demo.Query
{
    public partial class InstanceList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            _ctlList.DataSource = WF.Engine.InstanceStorage.FindList(0, 9999).Items;
            _ctlList.DataBind();
        }

        public string ResolveUrl(object paramObj)
        {
            WF.Instance instance = paramObj as WF.Instance;
            string targetUrl = string.Format("{0}?wf:instance={1}", instance.State.Activity.Property.Page.Address, instance.Id);
            return Page.ResolveClientUrl(targetUrl);
        }
    }
}